package io.vov.vitamio.entity;

import java.util.ArrayList;
import java.util.List;

import org.w3c.dom.Element;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * 在线直播电视实体类
 * 
 */
@DatabaseTable(tableName = "OnlineVideo")
public class OnlineVideo {

	@DatabaseField(generatedId = true)
	// 自增长的主键
	public Integer id;

	/**
	 * 节目顺序
	 */
	@DatabaseField
	// 声明数据库字段
	public String num;

	/**
	 * 作为获取节目单ID
	 */
	@DatabaseField
	// 声明数据库字段
	public String source_code;

	/**
	 * 标题
	 */
	@DatabaseField
	public String title;
	/**
	 * ??
	 */
	@DatabaseField
	public String version;

	/**
	 * 电视台说明
	 */
	@DatabaseField
	public String desc;

	/**
	 * 电视台LOGO
	 */
	@DatabaseField
	public String icon_url;

	/**
	 * 唯一标识码
	 */
	@DatabaseField
	public String guide;

	/**
	 * 源地址链接
	 */
	public List<OnlineVideoSource> sourceList = new ArrayList<OnlineVideoSource>();

	/**
	 * 节目分类下的Id
	 */
	@DatabaseField
	public String categoryId;

	/**
	 * 是否收藏的节目
	 */
	@DatabaseField
	public boolean isFavorite = false;

	/** 是否目录 */
	public boolean is_category = false;

	/** 0视频 1电视 */
	public int category;

	/** ?? */
	public int level = 1;

	/**
	 * 临时用
	 */
	public Element el;

	public OnlineVideo() {

	}

	public OnlineVideo(String num, String source_code, String title, String version, String desc, String icon_url, String guide, String categoryId, boolean favorite) {
		super();
		this.num = num;
		this.source_code = source_code;
		this.title = title;
		this.version = version;
		this.desc = desc;
		this.icon_url = icon_url;
		this.guide = guide;
		this.categoryId = categoryId;
		this.isFavorite = favorite;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public String getIcon_url() {
		return icon_url;
	}

	public void setIcon_url(String icon_url) {
		this.icon_url = icon_url;
	}

	public List<OnlineVideoSource> getSourceList() {
		return sourceList;
	}

	public void setSourceList(List<OnlineVideoSource> sourceList) {
		this.sourceList = sourceList;
	}

	public void addSource(OnlineVideoSource source) {
		this.sourceList.add(source);
	}

	public boolean isIs_category() {
		return is_category;
	}

	public void setIs_category(boolean is_category) {
		this.is_category = is_category;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}

	public String getSource_code() {
		return source_code;
	}

	public void setSource_code(String source_code) {
		this.source_code = source_code;
	}

	public String getGuide() {
		return guide;
	}

	public void setGuide(String guide) {
		this.guide = guide;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	
	public boolean isFavorite() {
		return isFavorite;
	}

	public void setFavorite(boolean isFavorite) {
		this.isFavorite = isFavorite;
	}

	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return this.getClass() + " [id: " + id + "], " + "[title: " + title + "], " + "[source_id: " + source_code + "], " + "[url: ], " + "[is_category: " + is_category + "], " + "[category: " + category + "], " + "[desc: " + desc + "], " + "[icon_url: " + icon_url + "]\n";
	}

}
